<template>
    <el-form :model="logoutFormData">
        <el-form-item label="" >
            <el-button type="primary" class="btn-block" @click="authLogout()">退出登录</el-button>

        </el-form-item>

    </el-form>
</template>

<script>
    import ApiAuth from '../services/api-auth'
    export default {
        props: {
            formLabelWidth: {
                type: String,
                default: '120px'
            },
            authGuard: {
                type: String,
                default: 'api'
            },
        },

        data() {
            return {

                logoutFormData: {},

            }
        },
        created() {
            let _this = this;

        },
        destroyed(){

        },
        mounted() {
            let _this = this

        },
        methods: {
            joinToString: function (obj, glue) {
                return LeUtils.joinToString(obj, glue)
            },
            authLogout: function () {
                let _this = this;
                ApiAuth.logout(_this.authGuard).then(function () {
                    _this.$message.success('退出成功');
                    _this.user = null;
                    _this.$emit('logouted');
                })

            },

        }
    }
</script>
